/**
 * 
 */
package com.nervytech.tutorcruise.profile.beans.builders;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.nervytech.tutorcruise.db.dao.model.InstituteProfile;
import com.nervytech.tutorcruise.db.service.interfaces.IInstituteProfileService;
import com.nervytech.tutorcruise.profile.beans.InstituteProfileBean;
import com.nervytech.tutorcruise.profile.beans.UserBean;
import com.nervytech.tutorcruise.service.exception.TrainerCruiseServiceException;


/**
 * @author ADMIN
 *
 */
@Component("instituteProfileBeanBuilder")
public class InstituteProfileBeanBuilder implements IProfileBeanBuilder {
	
	@Autowired
	private IInstituteProfileService instProfileService;


	/* (non-Javadoc)
	 * @see com.nervytech.tutorcruise.profile.beans.builders.IProfileBeanBuilder#getProfileBean()
	 */
	@Override
	public Object getProfileBean(long userId) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public <T extends UserBean> T getProfileBeanG(long userId)
			throws TrainerCruiseServiceException {
		
		InstituteProfile instProfile = instProfileService.getInstituteProfile(userId);
		
		InstituteProfileBean profileBean = new InstituteProfileBean();
		profileBean.setAboutInstitute(instProfile.getAboutInstitute());
		profileBean.setAddress(instProfile.getAddress());
		profileBean.setCategory(instProfile.getCategory());
		profileBean.setCertifications(instProfile.getCertifications());
		profileBean.setCity(instProfile.getCity());
		profileBean.setContactNumber(instProfile.getContactNumber());
		profileBean.setCoursesOffered(instProfile.getCoursesOffered());
		profileBean.setEmail(instProfile.getEmail());
		profileBean.setFullName(instProfile.getFullName());
		profileBean.setImageUrl(instProfile.getImageUrl());
		profileBean.setIsPortalCertified(instProfile.getIsPortalCertified());
		profileBean.setIsTechCertified(instProfile.getIsTechCertified());
		profileBean.setPhone(instProfile.getPhone());
		profileBean.setRating(instProfile.getRating());
		profileBean.setTaggedSkills(instProfile.getTaggedSkills());
		profileBean.setWebsite(instProfile.getWebsite());
		profileBean.setZipCode(instProfile.getZipCode());
		
		return (T)profileBean;
	}

}
